package analysisOfConcurrent.quickcheck;
import static net.java.quickcheck.generator.PrimitiveGenerators.integers;
import static net.java.quickcheck.generator.PrimitiveGenerators.letterStrings;

public class Call {
	
	enum Function{
		ADD_BY_INDEX,GET_BY_INDEX,REMOVE_BY_INDEX,SIZE,ADD_BY_ELEMENT
	}
	
	private Function function;
	
	private int index;
	private String element;
	
	public void nextFunction(){
		
		int i = integers(0,4).next();
		if(i == 0)
			setFunction(Function.ADD_BY_INDEX);
		else if(i == 1)
			setFunction(Function.GET_BY_INDEX);
		else if(i == 2)
			setFunction(Function.REMOVE_BY_INDEX);
		else if(i == 3)
			setFunction(Function.SIZE);
		else setFunction(Function.ADD_BY_ELEMENT);
		
	}
	
	public void nextArgs(){
		setIndex(integers(0,15).next());
		setElement(letterStrings().next());
	}
	
	public Function getFunction() {
		return function;
	}

	public void setFunction(Function function) {
		this.function = function;
	}

	public int getIndex() {
		return index;
	}

	public void setIndex(int index) {
		this.index = index;
	}

	public String getElement() {
		return element;
	}

	public void setElement(String element) {
		this.element = element;
	}

	

}
